<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>VUE3：条件渲染基本使用</title>
  </head>
  <body>
    <div id="app"></div>

    <template id="tpl">
      <div v-if="isShow">Hello, 世界</div>
      <button @click="isShow = !isShow">切换</button>
    </template>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
      Vue.createApp({
        template: "#tpl",
        data() {
          return {
            isShow: true,
          };
        },
      }).mount("#app");
    </script>
  </body>
</html>
